import React, { Component } from 'react'
import Top from '../components/top'
import Bottom from '../components/bottom'
import axios from 'axios'
// 兄弟组件传参，要下包，events
 class Wrap extends Component {
  state = {
      arr:[]
  }
  componentDidMount(){
      axios.get("/tab").then(res=>{
          console.log(res.data);
          this.setState({
              arr:res.data
          })
      })
  }
  render() {
    return (
      <div>
          {
              this.state.arr && this.state.arr.length ?   <Top send={this.state.arr}></Top>:"暂无数据"
          }
          {
                this.state.arr && this.state.arr.length ?    <Bottom send={this.state.arr}></Bottom> :"暂无数据"
          }
        
      </div>
    )
  }
}

export default Wrap